package org.yzh.scheduler.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobKey;
import org.yzh.scheduler.schedule.RemoteHttpTrigger;

public class RemoteHttpJobBean implements Job {

    private static RemoteHttpTrigger remoteHttpTrigger;

    public static void setRemoteHttpTrigger(RemoteHttpTrigger remoteHttpTrigger) {
        RemoteHttpJobBean.remoteHttpTrigger = remoteHttpTrigger;
    }

    @Override
    public void execute(JobExecutionContext context) {
        JobKey jobKey = context.getTrigger().getJobKey();

        remoteHttpTrigger.trigger(jobKey.getName(), jobKey.getGroup());
    }
}